package cn.kill.orderservice.service.base;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.common.BaseMapper;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author 张在成
 */
public abstract class BaseService<T> {

    @Autowired
    private BaseMapper<T>  baseMapper;


    public int deleteByPrimaryKey(Object key) {
        return baseMapper.deleteByPrimaryKey(key);
    }


    public int delete(T record) {
        return baseMapper.delete(record);
    }


    public int insert(T record) {
        return baseMapper.insert(record);
    }


    public int insertSelective(T record) {
        return baseMapper.insertSelective(record);
    }


    public boolean existsWithPrimaryKey(Object key) {
        return false;
    }


    public List<T> selectAll() {
        return baseMapper.selectAll();
    }


    public T selectByPrimaryKey(Object key) {
        return baseMapper.selectByPrimaryKey(key);
    }


    public int selectCount(T record) {
        return baseMapper.selectCount(record);
    }


    public List<T> select(T record) {
        return baseMapper.select(record);
    }


    public T selectOne(T record) {
        return baseMapper.selectOne(record);
    }


    public int updateByPrimaryKey(T record) {
        return baseMapper.updateByPrimaryKey(record);
    }


    public int updateByPrimaryKeySelective(T record, Example example) {
        return baseMapper.updateByPrimaryKeySelective(record);
    }


    public int deleteByExample(Object example) {
        return 0;
    }


    public List<T> selectByExample(Object example) {
        return null;
    }


    public int selectCountByExample(T example) {
        return 0;
    }


    public T selectOneByExample(T example) {
        return null;
    }


    public int updateByExample(T record, Object example) {
        return 0;
    }


    public int updateByExampleSelective(T record, Object example) {
        return 0;
    }


    public List<T> selectByExampleAndRowBounds(Object example, RowBounds rowBounds) {
        return null;
    }


    public List<T> selectByRowBounds(T record, RowBounds rowBounds) {
        return null;
    }

}
